import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/index/login',
    // url: 'http://122.51.249.55:7005/admin/index/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/index/userinfo',
    method: 'post'
  })
}
export function getuserList(params) { // 获取用户列表
  return request({
    url: '/permission/user',
    method: 'GET',
    params
  })
}
export function updateStatus(id, status) { // 修改用户状态
  return request({
    url: `/permission/user/${id}/${status}`
  })
}

export function getRoleList() {
  return request({
    url: '/permission/role'
  })
}

export function delRole(id) {
  return request({
    url: `/permission/user/${id}`,
    method: 'DELETE'
  })
}
export function addRole(data) {
  return request({
    url: '/permission/user',
    method: 'POST',
    data
  })
}
export function getUserInfo(id) { // 获取用户详细信息
  return request({
    url: `/permission/user/${id}`
  })
}
export function updateUserInfo(data) { // 获取用户详细信息
  return request({
    url: `/permission/user/${data.id}`,
    method: 'PUT',
    data
  })
}
export function getUserINfoByxxx(params) { // 获取用户详细信息
  return request({
    url: '/permission/user',
    params
  })
}

